﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Windows.Media;
using System.Windows;

namespace IGolovkine.ShoutCastRipper.UI.AdminPanel
{
    public class StationRipperStatusItem : INotifyPropertyChanged
    {
        private string _name;
        public string Name
        {
            get { return _name; }
            set { this.SetProperty(ref _name, value, "Name"); }
        }

        private string _status;
        public string Status
        {
            get { return _status; }
            set { this.SetProperty(ref _status, value, "Status"); }
        }

        private string _contentTitle;
        public string ContentTitle
        {
            get { return _contentTitle; }
            set { this.SetProperty(ref _contentTitle, value, "ContentTitle"); }
        }

        private string _contentLength;
        public string ContentLength
        {
            get { return _contentLength; }
            set { this.SetProperty(ref _contentLength, value, "ContentLength"); }
        }

        private string _url;
        public string Url
        {
            get { return _url; }
            set { this.SetProperty(ref _url, value, "Url"); }
        }

        private void SetProperty<T>(ref T field, T newValue, string propertyName)
        {
            if (!object.Equals(field, newValue))
            {
                field = newValue;
                this.OnPropertyChanged(propertyName);
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;
        protected virtual void OnPropertyChanged(string propertyName)
        {
            if (this.PropertyChanged != null)
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
